<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
	<ul class="nav nav-pills">
		<li class="active"><a href="${ctx }/welcome.jsp">首页</a></li>
		<li><a href="${ctx }/cart/showCart.do">购物车 <c:set
					var="sum" value="0"></c:set> <c:forEach var="item"
					items="${cart.items }" varStatus="status">
					<c:set var="sum" value="${sum+item.value.amount}"></c:set>
				</c:forEach> <c:if test="${sum == 0 }">
					<span class="glyphicon glyphicon-shopping-cart" id="cart"
						style="color: rgb(255, 140, 60);"></span>
				</c:if> <c:if test="${sum > 0 }">
					<span class="glyphicon glyphicon-shopping-cart" id="cart"
						style="color: rgb(255, 140, 60);">${sum}</span>
				</c:if>
		</a></li>
		<li><c:if test="${user != null }">
				<a href="${ctx }/userlistOrder.do?userId=${user.id}" title="查看">历史订单</a>
			</c:if></li>
		<li class="pull-right"><c:if test="${user == null }">
				<a href="${ctx }/web/login.jsp">登 录</a>
			</c:if> <c:if test="${user != null }">
								欢迎你，${user.name }  <button type="button"
					class="btn btn-danger btn-sm" onclick="location='${ctx}/user/userLogout.do'">退出</button>
			</c:if></li>
	</ul>
</body>
</html>